import sys
sys.path.insert(0,'../')
from RestAPI.amazon.S3 import  S3Request,S3session,Bucket,FileObject
from RestAPI.core.APIExceptions import *
import unittest
import setting

class testBucket(unittest.TestCase):
    def setUp(self):
        self.session=S3session()
        self.session.setCredential(setting.AUTHID,setting.AUTHKEY)
        #self.session.createBucket('feignwolf-test5')
        self.bucket=self.session.createBucketObj('feignwolf-test')
    def testList(self):
        print "test listing information in %s\n====================================================" % (self.bucket.name)
        filelist=self.bucket.ls(pageSize=5)
        for page in filelist:
            print page
            for f in page:
                print page[f].__versions__

if __name__ == '__main__':
    unittest.main()
